{% extends "master.volt" %}
{% block content %}
    <style>
        .jumbotron p {
            font-size: 15px;
        }
    </style>
    <div class="jumbotron">
        <h2>Excel 工具</h2>
        <p>UNION_ID为项目唯一标识</p>
        <p>每当我们需要粘合多个excel时，又不想让他们与之前的工作项目混杂在一起，就需要有一个唯一的UNION_ID来标识，这几张excel是否是一个工作项目。</p>
        <p>主键：多张excel根据某个主键进行拼接</p>
    </div>
    <div class="row">
        <div class="col-md-4">
            <form role="form" method="post" action="{{ url('/add') }}" enctype="multipart/form-data">
                <div class="form-group">
                    <label>UNION ID</label>
                    <input type="text" class="form-control" id="union_id" name="union_id" placeholder="UNION ID"
                           value="{{ union_id }}">
                </div>
                <div class="form-group">
                    <label>工作表</label>
                    <input type="text" class="form-control" name="sheet" placeholder="工作表" value="0">
                </div>
                <div class="form-group">
                    <label>Excel 主键</label>
                    <input type="text" class="form-control" name="pid" placeholder="Excel 主键">
                </div>
                <div class="form-group">
                    <label>关系映射表</label>
                    <input type="text" class="form-control" name="relation[]" placeholder="关系映射表 -分隔">
                    <input type="text" class="form-control" name="relation[]" placeholder="关系映射表 -分隔">
                    <input type="text" class="form-control" name="relation[]" placeholder="关系映射表 -分隔">
                    <input type="text" class="form-control" name="relation[]" placeholder="关系映射表 -分隔">
                </div>
                <div class="form-group">
                    <label>File input</label>
                    <input type="file" name="file">
                    <p class="help-block">Example block-level help text here.</p>
                </div>
                <div class="checkbox">
                    <label>
                        <input type="checkbox" name="is_main"> 是否主表
                    </label>
                </div>
                <button type="submit" class="btn btn-default">Submit</button>
                <a onclick="build()" class="btn btn-success">Build</a>
            </form>
        </div>
    </div>
{% endblock %}
{% block js %}
    <script>
        function build() {
            location = "{{ url('/build/') }}" + $("#union_id").val();
        }
    </script>
{% endblock %}
